<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="modal-dialog">
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal"
				aria-hidden="true">X</button>
			<h3 id="myModalLabel">${empty entity?'新增':'修改' }活动列表信息</h3>
		</div>
		<div class="modal-body">
			<form class="form-horizontal" method="post" id="sysUserForm"
				name="activityAwardForm"
				action="activityaward/save${empty entity?'Insert':'Update' }.htm"
				role="form">
				<div class="form-group">
					<label class="col-sm-2 control-label">奖品名称<font
						color="red">&nbsp;*</font></label>
					<div class="col-sm-10">
						<input type="hidden" value="${entity.awardId }"
							name="awardId" /> <input type="text" class="form-control"
							id="activityAward_awardName" name="awardName" value="${entity.awardName }">
					</div>
				</div>
					<div class="form-group">
					<label class="col-sm-2 control-label">奖品个数<font
						color="red">&nbsp;*</font></label>
					<div class="col-sm-10">
						<input type="hidden" value="${entity.awardId }"
							name="awardId" /> <input type="text" class="form-control"
							id="activityAward_num" name="num" value="${entity.num }">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">状态<font color="red">&nbsp;*</font></label>
					<div class="col-sm-10">
						<label class="checkbox-inline"> <input type="radio"
							name="status" value="1" ${entity.status=='1'?'checked':'' }>
							开启
						</label> <label class="checkbox-inline"> <input type="radio"
							name="status" value="0" ${entity.status=='0'?'checked':'' }>
							关闭
						</label>
					</div>
				</div>
				<span id="tip"
					style="color: red; font-size: 14px; margin-left: 20px;"></span>
			</form>
		</div>
		<div class="modal-footer">
			<button class="btn btn-default" data-dismiss="modal"
				aria-hidden="true">取消</button>
			<button class="btn btn-primary" data-dismiss="modal">保存</button>
		</div>
	</div>
</div>
<script type="text/javascript"
	src="resources/js/My97DatePicker/WdatePicker.js" charset="utf-8"></script>
<script type="text/javascript">
	function check_fun() {
		$("#tip").html("");
		var b = true;
		var status = $('input[name="status"]:checked').val();
		if ('${entity}' == '') {
			var file = document.activityAwardForm.activityAwardFile.value;
			var fileBack = document.activityAwardForm.activityAwardFileBack.value;
			var filepath = $("#activityAwardFile_input").val();
			var filepathBack = $("#activityAwardFileBack_input").val();
			if (file == "" || fileBack == "" || fileBack == ""
					|| filepath == null || filepath == ''
					|| filepathBack == null || filepathBack == '') {
				$("#tip").html("请选择图片");
				b = false;
			}

		}
	
		if (status == undefined) {
			$("#tip").html("请选择状态");
			b = false;
		}
		if (awardName == null || url.trim() == '') {
			$("#tip").html("请输入名称");
			b = false;
		}
	
		return b;
	}
</script>